package com.stormrage.edu.serv.acct.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.ent.EntResDao;
import com.stormrage.edu.serv.acct.EntResServ;
import com.stormrage.entity.ent.EntRes;
import com.stormragetech.core.exception.StormrageTechException;


/**
 * @author www.stormragetech.com
 * @date 2016年1月19日
 * @version 1.0.0
 */
@Service
public class EntResServImpl implements EntResServ {

	private static final Logger logger = LoggerFactory.getLogger(EntResServImpl.class);

	@Autowired
	private EntResDao resDao;

	@Override
	public EntRes queryById(Integer arg0) throws StormrageTechException {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);
		EntRes entity = resDao.queryById(map);
		logger.debug(" - 查询结果为 -" + entity);
		return entity;
	}

	@Override
	public List<EntRes> queryList() throws StormrageTechException {
		List<EntRes> array = resDao.queryList();
		logger.debug(" - 查询结果为 -" + array);
		return array;
	}

	@Override
	public List<EntRes> queryListByTypeParent(String arg0, Integer arg1) throws StormrageTechException {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("resType", arg0);
		map.put("parentId", arg1);
		List<EntRes> array = resDao.queryListByTypeParent(map);
		logger.debug(" - 查询结果为 -" + array);
		return array;
	}

	@Override
	public List<EntRes> queryListByAcctId(Integer arg0) throws StormrageTechException {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("acctId", arg0);
		List<EntRes> array = resDao.queryListByAcctId(map);
		logger.debug(" - 查询结果为 -" + array);
		return array;
	}

}
